<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>选择器权重</title>
		<!-- 选择器权重越高，选中几率越大 -->
		<style>
			 *{     /*权值 0    很容易被覆盖    !important 破坏权值 */
				color:#ffaa00 !important;  
				background: #4fcaff !important;
			}
			div{     /* 权值 1 */
				color: #55ff7f;
				background: #ffaaff;
			}
			.d1{   /*权值10 */
			color: #00ff00;
			background: #ffffff;
			}
			div.d1{   /*选择器权值之和  权值1+10 11 */
			color: #00ff00;
			background: #ffffff;
			}
			 body div.d1{ /*权值  12*/
				font-size: 25px;
				color: #00ff00;
				background: #ffaaff;
			}
			#d1{  /*权值 100 */
				color: #00ff00;
				background: #ffaaff;
			}
			div#d1{/* 权值101*/
				font-size: 20px;
				color: #00ff00;
				background: #ffaaff;
			}
			div#d1:hover{ /* 权值 111 */
				color: #ffaaff;
				background: #ffaa00;
			}
			
		</style>
	</head>
	<body>
		<div class="d1" id="d1" style="color: red;">Lorem ipsum dolor sit amet consectetur adipisicing elit. Quod, cum perferendis delectus doloribus aperiam magnam saepe architecto quas necessitatibus aliquid facere qui velit et est eos ipsa quasi perspiciatis tempore!</div>
	</body>
</html>